// [[ OnflowGenerator File UUID: e132cf29722a46fabbc65bda0781dd03  ]]
package com.itdct.onflow.system.file.controller

import com.itdct.onflow.core.type.*
import com.itdct.onflow.core.vo.KeyLabelValueVo
import com.itdct.onflow.core.vo.RespPageVo
import com.itdct.onflow.core.vo.RespVo
import com.itdct.onflow.system.common.base.BaseSysController
import com.itdct.onflow.system.file.qo.SysTransferCenterEditQo
import com.itdct.onflow.system.file.qo.SysTransferCenterSearchQo
import com.itdct.onflow.system.file.service.SysTransferCenterService
import com.itdct.onflow.system.file.vo.SysTransferCenterDetailVo
import com.itdct.onflow.system.file.vo.SysTransferCenterListVo
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.http.MediaType
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*

/**
 * @author DCTANT
 * @date 2025-09-28 16:32:52
 * @version 1.0
 * @description 系统传输中心接口控制
 */
@Tag(name = SysTransferCenterController.moduleName)
@RestController
@RequestMapping(value = ["/sysTransferCenter"], produces = [MediaType.APPLICATION_JSON_VALUE], method = [RequestMethod.POST])
class SysTransferCenterController(
    val sysTransferCenterService: SysTransferCenterService
) : BaseSysController() {
    companion object {
        const val moduleName = "系统传输中心"
    }

    @Operation(summary = moduleName + "添加")
    @PostMapping("/add.adw")
    fun add(@RequestBody @Validated(Add::class) qo: SysTransferCenterEditQo): RespVo<Long> {
        return sysTransferCenterService.add(qo, getContext())
    }

    @Operation(summary = moduleName + "更新")
    @PostMapping("/update.adw")
    fun update(@RequestBody @Validated(Update::class) qo: SysTransferCenterEditQo): RespVo<Unit> {
        return sysTransferCenterService.update(qo, getContext())
    }

    @Operation(summary = moduleName + "删除")
    @PostMapping("/delete.adw")
    fun delete(@RequestBody @Validated(Delete::class) qo: SysTransferCenterEditQo): RespVo<Unit> {
        return sysTransferCenterService.delete(qo, getContext())
    }

    @Operation(summary = moduleName + "详情")
    @PostMapping("/detail.adw")
    fun detail(@RequestBody @Validated(Detail::class) qo: SysTransferCenterSearchQo): RespVo<SysTransferCenterDetailVo> {
        return sysTransferCenterService.detail(qo, getContext())
    }

    @Operation(summary = moduleName + "列表")
    @PostMapping("/page.adw")
    fun page(@RequestBody @Validated(Page::class) qo: SysTransferCenterSearchQo): RespPageVo<SysTransferCenterListVo> {
        return sysTransferCenterService.page(qo, getContext())
    }

    @Operation(summary = moduleName + "我的导出列表")
    @PostMapping("/myExportPage.adw")
    fun myExportPage(@RequestBody @Validated(Page::class) qo: SysTransferCenterSearchQo): RespPageVo<SysTransferCenterListVo> {
        return sysTransferCenterService.myExportPage(qo, getContext())
    }

    @Operation(summary = moduleName + "我的导入列表")
    @PostMapping("/myImportPage.adw")
    fun myImportPage(@RequestBody @Validated(Page::class) qo: SysTransferCenterSearchQo): RespPageVo<SysTransferCenterListVo> {
        return sysTransferCenterService.myImportPage(qo, getContext())
    }

    @Operation(summary = moduleName + "打包下载")
    @GetMapping("/packageDownload.adw")
    fun packageDownload(@RequestParam(name = "id", defaultValue = "0") id: Long = 0L): RespVo<Unit> {
        return sysTransferCenterService.packageDownload(id, getContext())
    }

    // [[ OnflowGenerator Range (- selectFunctions -) Start ]]
    @Operation(summary = moduleName + "任务名称下拉选")
    @PostMapping("/selectNameList.adw")
    fun selectNameList(@RequestBody qo: SysTransferCenterSearchQo): RespVo<List<KeyLabelValueVo>> {
        return sysTransferCenterService.selectNameList(qo, getContext())
    }

// [[ OnflowGenerator Range (- selectFunctions -) End ]]
}